#define _CRT_SECURE_NO_WARNINGS 2

#include "SList.h"

int main() {
	SList* phead = NULL;
	SLPushFront(&phead, 1);
	SLPushFront(&phead, 2);
	SLPushFront(&phead, 3);
	SLPushFront(&phead, 4);
	SLPrint(phead);

	SLPushBack(&phead, 11);
	SLPushBack(&phead, 22);
	SLPushBack(&phead, 33);
	SLPushBack(&phead, 44);
	SLPrint(phead);

	SLPopFront(&phead);
	SLPopFront(&phead);
	SLPrint(phead);

	SLPopBack(&phead);
	SLPopBack(&phead);
	SLPrint(phead);

	SList* address = SLFind(phead, 44);
	if (address) {
		printf("find ! address is %p\n", address);
	}
	else {
		printf("not find\n");
	}

	SLInsertAfter(phead->next->next, 99);
	SLPrint(phead);

	SLInsertFront(&phead, phead->next, 100);
	
	SLRemoveFront(&phead, phead->next->next );
	SLPrint(phead);

	SLRemoveAfter(phead->next->next);
	SLPrint(phead);
	
	SLDestry(&phead);
	return 0;
}